<?php  
$this->headScript()
        ->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.core.js")
        ->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.widget.js")
        ->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.mouse.js")
        ->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.slider.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.datepicker.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/i18n/jquery.ui.datepicker-es.js")
		->appendFile($this->baseUrl()."/js/jquery/plugins/maskedinput/jquery.maskedinput-1.3.min.js");

$this->headLink()->appendStylesheet($this->baseUrl(). '/js/jquery/development-bundle/themes/base/jquery.ui.all.css')
				->appendStylesheet($this->baseUrl(). '/css/form_register_user.css');

$pais_default = (isset($this->inputPost['Country'])) ? $this->inputPost['Country'] : $this->Pais_Default;
$estado_default = (isset($this->inputPost['State'])) ? $this->inputPost['State'] : $this->Estado_Default ;

?>
<script type="text/javascript">
$(document).ready(function() {
	$.datepicker.setDefaults( $.datepicker.regional["es"] );
	var dates = $( "#Birthdate" ).datepicker({
		dateFormat: 'yy-mm-dd',
		changeMonth: true,
		changeYear: true,
		numberOfMonths: 1,
		maxDate: "<?php echo @date("Y-m-d"); ?>"
	});
	getestados(<?php echo (int)$pais_default; ?>, <?php echo (int)$estado_default; ?>);
});

jQuery(function($){
	   $("#Phone").mask("(999) 999-9999");
	   $("#Officephone").mask("(999) 999-9999");
	   $("#Birthdate").mask("9999-99-99");
	   $("#RFC").mask("**********?***");
	   $("#Cp").mask("9?999999");

	});
</script>
<!-- Formulario de registro -->
<div class="col2">
<form method="post" id="register_form" name="register_form" action="<?php echo $this->baseUrl();?>/users/registeruser/" >
	<div class="register">
		<div class="note" align="center">
			<strong>NOTA:</strong> para registrarse rellene los campos
			del formulario, los campos marcados con * son obligatorios.
		</div>

<?php 

if(is_array($this->messageError)){
	echo "<ul>";
	foreach($this->messageError as $err){
		echo "<li class='req'>".$err."</li>";
	}
	echo "</ul>";
	
}
?>
		<h6 class="bold">Datos Personales</h6>
		<div class="formssection">
			<ul class="forms" style="display:left">
				<li class="txt"><span class="req"></span></li>
				<li class="radiobtn">
					<input type="radio" name="Sr" value="Sr" checked="checked" />
					<span class="labletxt">Sr.</span>
					<input type="radio" name="Sr" value="Sra" />
					<span class="labletxt">Sra.</span>
				</li>
			</ul>
			
			<ul class="forms">
				<li class="txt">Nombre: <span class="req">*</span></li>
				<li class="inputfield"><input name="Name" id="Name" class="fechas" value="<?php echo (isset($this->inputPost['Name'])) ?  $this->inputPost['Name']: ''?>" type="text">
				</li>
			</ul>

			<ul class="forms">
				<li class="txt">Apellidos: <span class="req">*</span></li>
				<li class="inputfield"><input name="Surnames" id="Surnames"  value="<?php echo (isset($this->inputPost['Surnames'])) ?  $this->inputPost['Surnames']: ''?>" class="fechas" type="text"></li>
			</ul>

			<ul class="forms">
				<li class="txt">Fecha de nacimiento: <span class="req">*</span></li>
				<li class="inputfield"><input name="Birthdate" id="Birthdate"  value="<?php echo (isset($this->inputPost['Birthdate'])) ?  $this->inputPost['Birthdate']: ''?>" class="fechas" type="text">
					eg. 1985/05/24</li>
			</ul>

			<ul class="forms">

				<li class="txt">E-Mail Address: <span class="req">*</span>
				</li>
				<li class="inputfield"><input name="Email" id="Email" class="fechas"  value="<?php echo (isset($this->inputPost['Email'])) ?  $this->inputPost['Email']: ''?>" type="text"></li>
			</ul>

			<ul class="forms">

				<li class="txt">Usuario: <span class="req">*</span>
				</li>
				<li class="inputfield"><input name="Username" id="Username" value="<?php echo (isset($this->inputPost['Username'])) ?  $this->inputPost['Username']: ''?>" class="fechas" type="text"></li>
			</ul>

		</div>
		<h6 class="bold">Detalles de su negocio o empresa</h6>

		<div class="formssection">
			<ul class="forms">

				<li class="txt">Ingrese el nombre: <span class="req">*</span></li>
				<li class="inputfield"><input name="Company" id="Company" value="<?php echo (isset($this->inputPost['Company'])) ?  $this->inputPost['Company']: ''?>" class="fechas" type="text"></li>
			</ul>

		</div>
		<h6 class="bold">Información de facturación</h6>
		<div class="formssection">
		
			<ul class="forms">
				<li class="txt">RFC: <span class="req"></span>
				</li>
				<li class="inputfield"><input name="RFC" id="RFC" class="fechas" value="<?php echo (isset($this->inputPost['RFC'])) ?  $this->inputPost['RFC']: ''?>" type="text"></li>
			</ul>
		
			<ul class="forms">

				<li class="txt">Direcci&oacute;n: <span class="req">*</span>
				</li>
				<li class="inputfield"><input name="Address1" id="Address1" class="fechas" value="<?php echo (isset($this->inputPost['Address1'])) ?  $this->inputPost['Address1']: ''?>" type="text"></li>
			</ul>
			<ul class="forms">
				<li class="txt">Direcci&oacute;n Linea 2: <span class="req"></span>
				</li>
				<li class="inputfield"><input name="Address2" id="Address2" value="<?php echo (isset($this->inputPost['Address2'])) ?  $this->inputPost['Address2']: ''?>" class="fechas" type="text"></li>

			</ul>
			<ul class="forms">
				<li class="txt">Colonia: <span class="req"></span>
				</li>
				<li class="inputfield"><input name="Col" id="Col" class="fechas" value="<?php echo (isset($this->inputPost['Col'])) ?  $this->inputPost['Col']: ''?>" type="text"></li>
			</ul>
			<ul class="forms">
				<li class="txt">N&uacute;mero exterior: <span class="req"></span>
				</li>

				<li class="inputfield"><input name="NumExt" id="NumExt" value="<?php echo (isset($this->inputPost['NumExt'])) ?  $this->inputPost['NumExt']: ''?>" class="fechas" type="text"></li>
			</ul>
			<ul class="forms">
				<li class="txt">C&oacute;digo postal: <span class="req">*</span>
				</li>
				<li class="inputfield"><input name="Cp" id="Cp" class="fechas" value="<?php echo (isset($this->inputPost['CP'])) ?  $this->inputPost['CP']: ''?>" type="text"></li>
			</ul>
			<ul class="forms">

				<li class="txt">Ciudad / Municipio: <span class="req"></span>
				</li>
				<li class="inputfield"><input name="City" id="City" class="fechas" value="<?php echo (isset($this->inputPost['City'])) ?  $this->inputPost['City']: ''?>" type="text"></li>
			</ul>

			<ul class="forms">
				<li class="txt">Pais: <span class="req"></span>
				</li>
				<li class="inputfield">
					<select name="Country" id="Country" onchange="getestados(this.value);">
						<?php 
						$selected=null;
						foreach($this->Paises as $pais){
							$selected=($pais['Id']==$pais_default)? 'selected="selected"' : '';
						?>
							<option value="<?php echo $pais['Id'];?>" <?php echo $selected;?>><?php echo $pais['Pais'];?></option>
						<?php 
						}
						?>
				</select>
				</li>
			</ul>
			<ul class="forms">
				<li class="txt">Localidad / Provincia / Estado: <span class="req"></span>
				</li>
				<li class="inputfield">
					<select name="State" id="State">
						<option disabled="disabled" value="0">Seleccione un país</option>
					</select>
				</li>
			</ul>
			
			
			
		</div>
		<h6 class="bold">Informaci&oacute;n de contacto</h6>
		<div class="formssection">
			<ul class="forms">
				<li class="txt">Tel&eacute;fono casa: <span class="req"></span>
				</li>
				<li class="inputfield"><input name="Phone"  id="Phone" class="fechas" value="<?php echo (isset($this->inputPost['Phone'])) ?  $this->inputPost['Phone']: ''?>" type="text"></li>
				
			</ul>
			<ul class="forms">
				<li class="txt">Tel&eacute;fono oficina:</li>
				<li class="inputfield"><input name="Officephone" id="Officephone" value="<?php echo (isset($this->inputPost['Officephone'])) ?  $this->inputPost['Officephone']: ''?>"  class="fechas" type="text"></li>
			</ul>
		</div>
		<h6 class="bold">Recibir &uacute;ltimas novedades en mi correoo
			celular:</h6>

		<div class="formssection">
			<ul class="forms">
				<li class="txt">Suscribir: <span class="req"></span>
				</li>
				<li class="radiobtn"><input name="Newsletter" <?php echo (isset($this->inputPost['Newsletter']) && $this->inputPost['Newsletter']=='1') ? 'checked="checked"' : ''; ?> id="Newsletter" type="checkbox"></li>
			</ul>
		</div>
		<h6 class="bold">
			Ingresa tu contrase&ntilde;a</span></span>
		</h6>

		<div class="formssection">
			<ul class="forms">
				<li class="txt">Contrase&ntilde;a: <span class="req">*</span>
				</li>
				<li class="inputfield"><input name="Passwd" name="Passwd"  value="<?php echo (isset($this->inputPost['Passwd'])) ?  $this->inputPost['Passwd']: ''?>"  class="fechas" type="password">
				</li>
			</ul>
			<ul class="forms">
				<li class="txt">Confirmar contrase&ntilde;a: <span class="req">*</span>
				</li>

				<li class="inputfield"><input name="Repasswd" id="Repasswd" value="<?php echo (isset($this->inputPost['Repasswd'])) ?  $this->inputPost['Repasswd']: ''?>"  class="fechas" type="password">
				</li>
			</ul>
		</div>
		<br />
		<div class="centeredContent">
			<input type="submit" value="Registrarme" name="Registrarme" id="Registrarme" title="Registrarme" class="button">
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="reset" value="Borrar" title="Cancelar" class="button">
		</div>
<br /><br /><br />
	</div>
</form>
</div>
